{extend name="Base/common_user"/}
{block name="style"}
<link href="__PUBLIC__/home/fbot/robotList.css" rel="stylesheet">
{/block}
{block name="header"}

{/block}

{block name="body"}
	<div class="clearfix">
		{volist name="robots" id="robot"}
			<div class="robot-wrapper clearfix" apikey="{$robot.apikey}">
				<div class="robot-l">
					<a href="{:url('Robot/detail?id='.$robot['id'])}"><img src="__PUBLIC__/home/fbot/img/icon40.png" alt=""></a>
				</div>
				<div class="robot-r">
					<p><span title="{$robot.name|default=''}">{$robot.name|default=''}</span><i class="free">免费版</i></p>
					<div class="percentage-wrapper">
						<div class="per-con" callcount="5000" style="width: 100%;"></div>
					</div>
					<div class="url-to-wrp">
						<a href="{:url('Robot/detail?id='.$robot['id'])}">设置</a>
						<a href="javascript:void;">数据</a>
						<a class="delthis" href="javascript:;" robotid="{$robot.id}" robotname="小图">删除</a>
					</div>
				</div>
			</div>
		{/volist}		
		<div class="setRobot"><span></span>点击创建机器人</div>

	</div>
	
{/block}

{block name="script"}
	<script type="text/javascript">
		$(".setRobot").click(function(){
			$.post("{:url('Robot/createRebot')}", { }, function(data){
				console.log(data);
				if(data.code == 0){
					self.location = "{:url('Robot/detail')}?id=" + data.data.id;
				}else{
					alert(data.msg);
				}
			});
		});
	</script>
{/block}
